//
//  SchedulingRecordsV.m
//  Pad-test
//
//  Created by jayce on 17/3/20.
//  Copyright © 2017年 jjkj. All rights reserved.
//

#import "SchedulingRecordsV.h"

@implementation SchedulingRecordsV

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    [self resizeLineSpacingWithContent:self.schedulingRecordsTV.text];
}


- (void)setModel:(SchedulingRecordsModel *)model{
    _model = model;
    self.recordOfDateL.text = model.recordOfDate;
    //self.dayImg.image = ;
    //self.showImgView.image = model.imageName.length > 0 ? [UIImage imageNamed:model.imageName] : nil;
    self.directorNameL.text = model.directorName;
    self.monitorNameL.text = model.monitorName;
    self.dispatcherNameL.text = model.dispatcherName;
    self.ledIndicatorTV.text = model.ledIndicator;
    self.schedulingRecordsTV.text = model.schedulingRecords;
    [self resizeLineSpacingWithContent:model.schedulingRecords];
    self.firePreventionL.text = model.firePrevention;
    self.workingConditionL.text = model.workingCondition;
    self.safetyProtectionL.text = model.safetyProtection;
    self.outageRecordsTV.text = model.outageRecords;
    self.otherTV.text = model.other;
}

-(void)resizeLineSpacingWithContent:(NSString *)content{
    
    NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc]init];
    paragraphStyle.lineSpacing = 10;
    NSDictionary *attributes = @{
                                 NSFontAttributeName :[UIFont systemFontOfSize:16],
                                 NSParagraphStyleAttributeName:paragraphStyle
                                 };
    self.schedulingRecordsTV.attributedText = [[NSAttributedString alloc]initWithString:content attributes:attributes];
}
@end
